import Vue from 'vue'
import Vuex from 'vuex'
// import router from './modules/router'
import user from './modules/user'
import frame from './modules/frame';

import getters from './getters'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    fullscreen: false,
    autologin: true
  },
  mutations: {
    'SET_FULLSCREEN' (state, isFullscreen) {
      state.fullscreen = isFullscreen
    },
    CHANGE_LOGIN (state, n) {
      state.autologin = n
    }
  },
  modules: {
    // router,
    user,
    frame
  },
  getters,
  actions: {
    init ({ dispatch }) {
      dispatch('setIsLongScreen')
    },
    loginAction (context, n) {
      context.commit('CHANGE_LOGIN', n)
    }
  }
})

export default store
